package com.redoor.app.stake.workflow.service;


import com.redoor.app.stake.basicdata.model.BaseStake;
import com.redoor.app.stake.basicdata.model.RegistrationApplyForRedis;
import com.redoor.app.stake.workflow.model.controllerModel.WorkOrderCriteria;
import com.redoor.app.stake.workflow.model.serviceModel.BaseWorkOrderServiceBean;
import com.redoor.app.stake.workflow.model.serviceModel.WorkOrderNumBean;

import java.util.List;

/**
 *  工单流程的逻辑处理
 *
 * @author ZhangMumu
 * @date 2018/3/30 0030 20:53
 */
public interface WorkOrderService{


    /*****begin 功能描述:工单逻辑处理的开始与结束标记  author:zhangMumu  2018/3/31 0031 22:21*****/

    /**
     *  生成注册码工单
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 21:00
     * @param
     * @return
     */
    int reApplySaveAll(List<RegistrationApplyForRedis> registrationApplyForRedisList);
    /**
     *  注册码审核通过
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 21:00
     * @param   workOrderCriteria
     * @return
     */
    int reApplyAccept(WorkOrderCriteria workOrderCriteria);
    /**
     *  注册码审核拒绝
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 21:01
     * @param
     * @return
     */
    int reApplyReject(WorkOrderCriteria workOrderCriteria);
    /**
     *  生成桩维护工单
     *      1.目标桩不能存在审核中(装维护员待维护),已通过(桩维护已提交但未被审核)状态的工单则生成新工单
     *      2.目标桩处于待运行状态(stakeSatus=2)才能生成新工单(2018-02-02增加需求)
     *
     *      创建人uuid存入接收到前置调试成功之后的mq的记录对应的uuid
     * @author ZhangMumu
     * @date 2018/3/30 0030 21:01
     * @param
     * @return
     */
    int maApplySave(BaseStake stake,String mqUuid);
    /**
     *  桩维护提交
     *      生成对应的审核工单
     *      或
     *      激活对应的处于拒绝状态的审核工单
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 21:01
     * @param   uuid 工单的uuid
     * @return
     */
    int maApplySubmit(String uuid);
    /**
     *  桩维护审核通过
     *      审核通过之后关闭对应的维护工单
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 21:02
     * @param   workOrderCriteria
     * @return
     */
    int maChargeAccept(WorkOrderCriteria workOrderCriteria);
    /**
     *  桩维护审核拒绝
     *      拒绝之后激活对应的维护工单
     *
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 21:02
     * @param   workOrderCriteria
     * @return
     */
    int maChargeReject(WorkOrderCriteria workOrderCriteria);

    /*****end 功能描述:工单逻辑处理的开始与结束标记  author:zhangMumu  2018/3/31 0031 22:21*****/

    /*****begin 功能描述:工单列表功能处理开始与结束标记  author:zhangMumu  2018/3/31 0031 22:22*****/

    /**
     *  查找待办工单列表
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 16:42
     * @param
     * @return
     */
    List<BaseWorkOrderServiceBean> qryTodoWorkOrder(WorkOrderCriteria baseWorkorderCriteria);

    /**
     * 查找待办工单数量
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 16:44
     * @param
     * @return
     */
    int qryTodoWorkOrderNum(WorkOrderCriteria baseWorkorderCriteria);

    /**
     *  查找已办工单列表
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 16:43
     * @param
     * @return
     */
    List<BaseWorkOrderServiceBean> qryDoneWorkOrder(WorkOrderCriteria baseWorkorderCriteria);

    /**
     *  查找已办工单数量
     *
     * @author ZhangMumu
     * @date 2018/3/30 0030 17:03
     * @param
     * @return
     */
    int qryDoneWorkOrderNum(WorkOrderCriteria baseWorkorderCriteria);

    /**  
     *  统计工单数量
     *   
     * @author ZhangMumu  
     * @date 2018/4/19 0019 15:42  
     * @param   
     * @return   
     */  
    WorkOrderNumBean countWorkOrderNum();

    /*****end 功能描述:工单列表功能处理开始与结束标记  author:zhangMumu  2018/3/31 0031 22:22*****/
}
